// 1、获取轮播图
$.ajax({
  type: "get",
  url: "/slides",
  success: (res) => {
    // console.log(res);
    var html = template("rotaTpl", { data: res });
    $("#rotaImg").html(html);
    // swiper插件的js
    var swiper = new Swiper(".swiper-container", {
      speed: 1000,
      spaceBetween: 30,
      centeredSlides: true,
      autoplay: {
        delay: 2500,
        disableOnInteraction: false,
      },
      pagination: {
        el: ".swiper-pagination",
        clickable: true,
      },
      navigation: {
        nextEl: ".swiper-button-next",
        prevEl: ".swiper-button-prev",
      },
    });
  },
});
